package org.amphiprion.descentv2assistant.entity.comparator;

import java.util.Comparator;

import org.amphiprion.descentv2assistant.entity.EncounterHero;

public class EncounterHeroComparator implements Comparator<EncounterHero> {

	@Override
	public int compare(EncounterHero lhs, EncounterHero rhs) {
		if (lhs.getHero().getArchetype().getName().equals(rhs.getHero().getArchetype().getName())) {
			return lhs.getHero().getName().compareTo(rhs.getHero().getName());
		} else {
			return lhs.getHero().getArchetype().getName().compareTo(rhs.getHero().getArchetype().getName());
		}
	}
}
